<html>
<head>
	<title>NULL SK List</title>
	<style type="text/css">
	body {
		background-color: black;
		color: white;
		font-family: verdana;
		font-size: 80%;
	}	
	table.sample {
		border-width: 1px;
		border-spacing: 2px;
		border-style: inset;
		border-color: #808080;
		border-collapse: collapse;
		background-color: black;		
	}
	table.sample th {
		border-width: 2px;
		padding: 1px;
		border-style: inset;
		border-color: #808080;
		background-color: black;
		-moz-border-radius: ;
	}
	table.sample td {
		border-width: 2px;
		padding: 1px;
		border-style: inset;
		border-color: #808080;
		background-color: black;
		-moz-border-radius: ;
		font-size: 80%;
	}
	a:link, a:visited, a:active{
		color: #8000FF;
		text-decoration: none;
	}
	a:hover
	{
		color: #8000FF;	
	}
	</style>	
	<script src="http://static.wowhead.com/widgets/power.js" />
</head>
<body>
<center>
<?php
$user="junemann_nl";
$password="";
$database="junemann_nl";

$con = mysql_connect("localhost",$user,$password);
if(!$con)
{
	die("Unable to connect to server");
}

mysql_select_db($database, $con);

$resultChars = mysql_query("SELECT * FROM null_sk_characters ORDER BY Pos");

echo '</ br> <u><b>SK List</b></u>';
echo '<table class="sample">';
echo '<tr><td><b>Pos</b></td><td><b>Character</b></td></tr>';

while($charRow = mysql_fetch_array($resultChars))
{
  echo "<tr><td>" . $charRow['Pos'] . "</td><td>" . $charRow['Name'] . "</td></tr>";
}

echo '</table>';

echo '<br /><br /><br /> <u><b>Loot history</b></u>';
echo '<table class="sample">';
echo '<tr><td><b>Date/Time</b></td><td><b>Character</b></td><td><b>Item</b><td><b>Offspec</b></td></tr>';

$resultLoot = mysql_query("SELECT null_sk_loot.*, null_sk_characters.Name AS CharacterName, null_sk_items.Name AS ItemName FROM null_sk_loot 
							INNER JOIN null_sk_characters ON null_sk_characters.ID = null_sk_loot.CharacterID
							INNER JOIN null_sk_items ON null_sk_items.ID = null_sk_loot.ItemID
							ORDER BY null_sk_loot.DateTime DESC");
while($lootRow = mysql_fetch_array($resultLoot))
{
	echo "<tr><td>" . $lootRow['DateTime'] . "</td><td>" .$lootRow['CharacterName']. "</td>";
	echo "<td><a href='http://www.wowhead.com/?item=" .$lootRow['ItemID'] . "'>" . $lootRow['ItemName'] . "</a></td>";
	$isOffspec = $lootRow['IsOffspec'];
	if($isOffspec == "0")
	{
		echo "<td></td>";
	}	
	else
	{
		echo "<td align='right'>X</td>";		
	}
	echo "</tr>";
}  

echo '</table>';

mysql_close($con);
?>
</center>
</body>
</html>